<template>
  <div class="ref2father">
    <h1>这里是ref父组件</h1>
    <ref2son ref="ren"></ref2son>
    <button @click="test">测试</button>
  </div>
</template>
<script lang="ts" setup name='ref2father'>
import { ref } from "vue";
import ref2son from "./ref2son.vue";
// 数据
let ren = ref();
// 方法
function test() {
  console.log(ren.value.name); //张三
  console.log(ren.value.age); //18
  console.log(ren.value.person); //{name: '李四', age: 16}
  console.log(ren.value.personTwo); //{name: '王五', age: 19}
}
</script>
<style scoped>
.ref2father {
  width: 80vw;
  height: 80vh;
  border: 1px solid red;
}
</style>
